package com.panasonic.web.service.impl;

import com.panasonic.web.domain.cms.CmsExamQuestion;
import com.panasonic.web.mapper.CmsExamQuestionMapper;
import com.panasonic.web.service.ICmsExamQuestionService;
import com.panasonic.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试卷问题Service业务层处理
 * 
 * @author lwf
 * @date 2021-11-16
 */
@Service
public class CmsExamQuestionServiceImpl implements ICmsExamQuestionService 
{
    @Autowired
    private CmsExamQuestionMapper cmsExamQuestionMapper;

    /**
     * 查询试卷问题
     * 
     * @param id 试卷问题ID
     * @return 试卷问题
     */
    @Override
    public CmsExamQuestion selectCmsExamQuestionById(Long id)
    {
        return cmsExamQuestionMapper.selectCmsExamQuestionById(id);
    }

    /**
     * 查询试卷问题列表
     * 
     * @param cmsExamQuestion 试卷问题
     * @return 试卷问题
     */
    @Override
    public List<CmsExamQuestion> selectCmsExamQuestionList(CmsExamQuestion cmsExamQuestion)
    {
        return cmsExamQuestionMapper.selectCmsExamQuestionList(cmsExamQuestion);
    }

    /**
     * 新增试卷问题
     * 
     * @param cmsExamQuestion 试卷问题
     * @return 结果
     */
    @Override
    public int insertCmsExamQuestion(CmsExamQuestion cmsExamQuestion)
    {
        return cmsExamQuestionMapper.insertCmsExamQuestion(cmsExamQuestion);
    }

    /**
     * 修改试卷问题
     * 
     * @param cmsExamQuestion 试卷问题
     * @return 结果
     */
    @Override
    public int updateCmsExamQuestion(CmsExamQuestion cmsExamQuestion)
    {
        cmsExamQuestion.setUpdateTime(DateUtils.getNowDate());
        return cmsExamQuestionMapper.updateCmsExamQuestion(cmsExamQuestion);
    }

    /**
     * 批量删除试卷问题
     * 
     * @param ids 需要删除的试卷问题ID
     * @return 结果
     */
    @Override
    public int deleteCmsExamQuestionByIds(Long[] ids)
    {
        return cmsExamQuestionMapper.deleteCmsExamQuestionByIds(ids);
    }

    /**
     * 删除试卷问题信息
     * 
     * @param id 试卷问题ID
     * @return 结果
     */
    @Override
    public int deleteCmsExamQuestionById(Long id)
    {
        return cmsExamQuestionMapper.deleteCmsExamQuestionById(id);
    }
}
